#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int x,y,symbol,ans;
int n,temp,sum=0;
srand(time(0));
for(int i=1;i<=10;i++)
{
x=rand()%9+1;
y=rand()%9+1;
symbol=rand()%2;
if(x<y&&symbol==1)
{
temp=x;
x=y;
y=temp;	
}
switch(symbol)
{
case 0:
ans=x+y;
cout <<x<<'+'<<y<<'=';
break;
case 1:
ans=x-y;
cout <<x<<'-'<<y<<'=';
break;		
}
cin>>n;
if(n==ans)
{
sum+=10;
cout <<" 对!"<<endl;	
}
else
cout <<" 错!"<<endl;	
}
cout <<"得分:"<<sum<<endl;
return 0;	
}
